﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Web_Oto.Bases;
using Web_Oto.Data;
using Web_Oto.Data.Dto;

namespace Web_Oto.Business
{
    public class BannerBus : busObject
    {
        #region Constructor

        public BannerBus()
        {
            m_objDAL = new BannerDal(connectionstring, connectiontype);
        }

        public BannerBus(string connectionString)
            : base(connectionString)
        {
            m_objDAL = new BannerDal(connectionstring, connectiontype);
        }

        public BannerBus(string connectionString, string connectionType)
            : base(connectionString, connectionType)
        {
            m_objDAL = new BannerDal(connectionstring, connectiontype);
        }

        private BannerDal m_objDAL;

        #endregion

        #region methods

        public IList<BannerDto> GetAllBanners()
        {
            return m_objDAL.GetAllBanners();
        }

        public Banner GetBannerById(int id)
        {
            return m_objDAL.GetBannerById(id);
        }

        public int Delete(int id)
        {
            return m_objDAL.Delete(id);
        }

        public int Update(Banner banner)
        {
            return m_objDAL.Update(banner);
        }

        public int Insert(Banner banner)
        {
            return m_objDAL.Insert(banner);
        }

        public string GetFilePathById(int id)
        {
            return m_objDAL.GetFilePathById(id);
        }

        #endregion
    }
}
